#!/bin/sh
file_rrd_name=$1
file_img_name=$2
/usr/local/rrdtool-1.2.15/bin/rrdtool graph $file_img_name/tcp_day.png \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="tcp connection(day)" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="tcp connection" \
DEF:a="$file_rrd_name/tcpconnection":tcpconnection:AVERAGE \
AREA:a#EACC00:""  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" 

/usr/local/rrdtool-1.2.15/bin/rrdtool graph $file_img_name/tcp_weekly.png \
--imgformat=PNG \
--start=-604800 \
--end=-1800 \
--title="tcp connection(weekly)" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="tcp connection" \
DEF:a="$file_rrd_name/tcpconnection":tcpconnection:AVERAGE \
AREA:a#EACC00:""  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" 

/usr/local/rrdtool-1.2.15/bin/rrdtool graph $file_img_name/tcp_monthly.png \
--imgformat=PNG \
--start=-2678400 \
--end=-7200 \
--title="tcp connection(monthly)" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="tcp connection" \
DEF:a="$file_rrd_name/tcpconnection":tcpconnection:AVERAGE \
AREA:a#EACC00:""  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" 

/usr/local/rrdtool-1.2.15/bin/rrdtool graph $file_img_name/tcp_yearly.png \
--imgformat=PNG \
--start=-33053184 \
--end=-86400 \
--title="tcp connection(yearly)" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="tcp connection" \
DEF:a="$file_rrd_name/tcpconnection":tcpconnection:AVERAGE \
AREA:a#EACC00:""  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" 
